<?php include_once 'header.php';?>
	<div class="row">
		<div class="col-md-12">
			<div class="card-deck">
				<div class="card shadow mb-2">
					<div class="card-header">
						<strong class="card-title">
							<div>
								<label class="mb-0">验证码设置</label>
							</div>
						</strong>
					</div>
					
					<div class="card-body" >
						<form>
							<div class="row">
								<div class="col-6">
									<div class="form-group">
										<label>验证码长度</label>
										<input type="number" class="form-control" placeholder="建议值为：4~6" id="crc_length" value="<?=$this->admConf['CRC_LENGTH']?>">
									</div>
								</div>
								<div class="col-6">
									<div class="form-group">
										<label>验证码有效期</label>
										<div class="input-group">
											<input type="number" class="form-control" placeholder="建议值为：10" id="crc_exp" value="<?=$this->admConf['CRC_EXP'];?>">
											<div class="input-group-append">
												<span class="input-group-text">分钟</span>
											</div>
										</div>
									</div>
								</div>
							</div>	
							<div class="row">
								<div class="col-6">
									<div class="form-group">
										<label>邮箱服务器</label>
										<input type="text" class="form-control" placeholder="发信服务器，如腾讯企业邮箱：smtp.exmail.qq.com" id="smtp_host" value="<?=$this->admConf['SMTP_HOST'];?>">
									</div>
								</div>
								<div class="col-6">
									<div class="form-group">
										<label>邮箱发信端口</label>
										<input type="number" class="form-control" placeholder="一般发信端口为：25/465" id="smtp_port" value="<?=$this->admConf['SMTP_PORT'];?>">
									</div>
								</div>
							</div>	
							<div class="row">
								<div class="col-6">
									<div class="form-group">
										<label>邮箱账户</label>
										<input type="text" class="form-control" placeholder="发信邮箱账号" id="smtp_user" value="<?=$this->admConf['SMTP_USER'];?>">
									</div>
								</div>
								<div class="col-6">
									<div class="form-group">
										<label>邮箱密码</label>
										<input type="text" class="form-control" placeholder="发信邮箱密码" id="smtp_pass" value="<?=$this->admConf['SMTP_PASS'];?>">
									</div>
								</div>
							</div>
							<button type="submit" class="btn btn-primary btn-block" id="submit">提交</button>
						</form>
					</div>
				</div>
			</div>
			
		</div>
	</div>
	<script>
		$("#submit").click(function(){var submit_data={};submit_data.crc_length=$("#crc_length").val();submit_data.crc_exp=$("#crc_exp").val();submit_data.smtp_host=$("#smtp_host").val();submit_data.smtp_port=$("#smtp_port").val();submit_data.smtp_user=$("#smtp_user").val();submit_data.smtp_pass=$("#smtp_pass").val();$("#submit").html('<i class="spinner-ui fe fe-rotate-cw fe-12 mr-2"></i>正在提交');$("#submit").attr('disabled',true);$.ajax({cache:false,type:"POST",data:submit_data,dataType:'json',success:function(data){$("#submit").html('提交');$("#submit").attr('disabled',false);if(data.code==200){cocoMessage.success('更新成功',2000)}else{cocoMessage.error(data.msg,2000)}}});return false});
	</script>	
<?php include_once 'footer.php';?>